﻿using System;
using System.IO;

namespace _03.LineNumbering
{
    class LineNumbering
    {
        static void Main()
        {
            using (StreamWriter sw = new StreamWriter("TextWithLines.txt"))
            {
                using (StreamReader sr = new StreamReader(@"..\..\LineNumbering.cs"))
                {
                    string line = sr.ReadLine();
                    int lineCounter = 0;
                    while (line != null)
                    {
                        sw.WriteLine("{0:000} {1}", ++lineCounter, line);
                        line = sr.ReadLine();
                    }
                }
            }
        }
    }
}
